class Solution:
    def minimumSum(self, num: int) -> int:
        f = [int(v) for v in str(num)]
        f.sort()
        return (f[0] + f[1]) * 10 + f[2] + f[3]
